import style from '@/common/js/style.js';
// #ifdef MP
function toPx(value) {
	const result = /(\d+\.?\d*)(\w+)/.exec(value);
	if ('rpx' === result[2].trim()) {
		return uni.getSystemInfoSync().screenWidth * Number(result[1]) / 750;
	} else if('px' === result[2].trim()) {
		return Number(result[1]);
	} else {
		throw new TypeError(`${value}单位格式不正确`);
	}
	
}

const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight;
const windowWidth = systemInfo.windowWidth;
const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
let navBarHeight = menuButtonInfo.height + 2*(menuButtonInfo.top - statusBarHeight);
let navBarRightOffset = windowWidth - menuButtonInfo.left;
// console.log(menuButtonInfo,statusBarHeight, systemInfo);
// #endif

const cart = {
	data() {
		return {
			navBarConfig: {
				// #ifndef MP
				fixedHeight: `100rpx`,
				// #endif
				// #ifdef MP
				fixedHeight: `${navBarHeight}px`,
				// #endif
				title: {
					fontFamily: 'tpf-iconfont',
					textStyle: `
								font-size: ${style.UNI_ICON_SIZE_SM};
								color:${style.UNI_TEXT_COLOR_WHITE};
								`,
					iconList: [
						{
							id: '',
							text: '佣金结算',
						}
					],
				},
				left: {
					
					fontFamily: 'tpf-iconfont',
					iconStyle: `margin-left: ${style.UNI_SPACING_COL_BASE};`,
					textStyle: `color: ${style.UNI_TEXT_COLOR_WHITE}`,
					iconList: [
						{
							id: 'back',
							thumb:"",
							text: '\ue602',
							textStyle: ``,
						}
					]
				
				},
				right: {
					fontFamily: 'tpf-iconfont',
					textStyle: `margin-right: ${style.UNI_SPACING_COL_BASE};
								font-size: ${style.UNI_ICON_SIZE_SM};
								color:${style.UNI_TEXT_COLOR_WHITE};
								`,
					iconList: [
						{
							id: 'message',
							text: '\ue61d',
						}
					],
					btns:{
						manager:"管理",
						over:"完成"
					}
				}
					
			},
			cartBarConfig:{
				leftIco:{
					fontFamily: 'tpf-iconfont',
					text: '\ue61b'
				}
			},
			commissionConfig:{
				cashOutTips:[
					"提现金额必须大于100",
					"提现到账时间可能会有延迟，请耐心等待",
					"每月可提现一次，每次提现金额不得大于10000元"
				],
				cashOutItems:[
					{
						id:"wechat",
						text:"提现到微信",
						style:`background-color: #04be02;`
					},
					{
						id:"alipay",
						text:"提现到支付宝",
						style:`background-color: #00aaee;`
					},
					{
						id:"bankcard",
						text:"提现到银行卡",
						style:`background-color: #005dab;`
					}
				]
			},
			extListConfig: {
				fontFamily: 'tpf-iconfont',
				titleStyle: `font-size: ${style.UNI_FONT_SIZE_SM};margin-left: ${style.UNI_SPACING_ROW_SM};`,
				subtitleStyle: `font-size: ${style.UNI_FONT_SIZE_MI};margin-top: ${style.UNI_SPACING_ROW_SM};`,
				moreIcon:{
					url:"",
					text: '\ue605',
				},
				iconList:[
					{
						url:"/pages/ucenter/cash-out-log/cash-out-log",
						text: '\ue729',
						title: '提现记录',
					}
				]
			},
		}	
	},
}

export default cart;